
module Hw1 : Hw1Sig.T =
struct

let rec fact n = match n with 
  | 0 -> 1
  | n -> n * fact (n -1)

let rec fib n = match n with
  | 0 -> 1
  | 1 -> 1
  | n -> fib (n-1) + fib (n-2)

let rec fast_fib n = match n with
  | 1 -> (1, 1)
  | n -> let a, b = fast_fib (n-1) in
           (b, a+b)

end

